package pt.fct.mpc.lastfm.generic;

import pt.fct.mpc.lastfm.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class TextActivity extends Activity {
	
	private static final String TAG = "Last.fm Image Activity";

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.text);

		//Reads the info sent by the intent
		Intent the_intent_that_gave_life_to_everything = getIntent();
		Bundle intent_data = 
			the_intent_that_gave_life_to_everything.getExtras();

		if (intent_data == null) {
			Log.e(TAG, "No extra data");
			finish();
		}

		String text = intent_data.getString("text");
		
		if (text == null)	{
			Log.e(TAG, "Null bundle parameters: text = "
					+ text);
			finish();
		}
		
        TextView textView = (TextView)findViewById(R.id.text);
        textView.setText(text);
	}
}